package cn.wen.yaling.commons.utils;import cn.wen.yaling.commons.entity.LogEntity;import cn.wen.yaling.commons.entity.UserEntity;import cn.wen.yaling.commons.enums.Log;import cn.wen.yaling.commons.enums.SysType;import javax.servlet.http.HttpServletRequest;import java.util.Date;/** * 编写日志的工具类 */public class LogUtils {    /**     * 传入操作类型、操作员、请求来实例化Log日志对象     * @param user     * @param request     * @param log     * @return     */    public static LogEntity instanceLog(UserEntity user, HttpServletRequest request, Log log, SysType sysType) {        String ipAddr = IPUtils.getIpAddr(request);        LogEntity logEntity = new LogEntity();        logEntity.setLogStatus(1);        logEntity.setCreateTime(new Date());        logEntity.setHandlerIp(ipAddr);        logEntity.setLogContent(log.getCode());        logEntity.setLogUrl(request.getRequestURL().toString());        return logEntity;    }}